{% extends 'admin/master.html' %}
{% block head_tail %}
    <script src="{{ url_for('static', filename='plugins/echarts/echarts.min.js') }}"></script>
    <script src="{{ url_for('static', filename='plugins/echarts/echarts-gl.min.js') }}"></script>
    <script src="{{ url_for('static', filename='plugins/echarts/china.js') }}"></script>
    <link rel="shortcut icon" href="{{ url_for('static',filename='img/favicon.ico') }}" type="image/x-icon"/>
    <style type="text/css">
        .tab {
            overflow: hidden;
            border-bottom: 1px solid #2b2b2b;
            background-color: whitesmoke;
            width: 100%;
            height: 48px;
        }
        .tab button {
            background-color: inherit;
            width: 200px;
            font-size: medium;
            float: left;
            border: none;
            border-right: 1px solid lightgray;
            outline: none;
            cursor: pointer;
            padding: 12px 16px;
            transition: 0.3s;
        }
        .tab button:hover {
            background-color: #ddd;
        }
        .tab button.active {
            background-color: #ccc;
        }
        .chart-container {
            display: none;
            padding: 6px 12px;
            border-top: none;
            width: 100%;
            height: 500px;
        }
    </style>
{% endblock %}
{% block body %}
    {{ super() }}
    {# 未登陆或未授权用户，不显示相应内容！ #}
    {% if current_user and current_user.is_authenticated %}
    <div class="">
        <div class="">
            <div class="col-sm-12 col-sm-offset-0">
                <h1>总览</h1>
                <div class="tab">
                    <button class="tablinks" onclick="showChart(event, 'general_pies')">
                        统计
                    </button>
                </div>
                <div class="box">
                    <div id="general_pies" class="chart-container"></div>
                </div>
                <div id="footer" style="width: 100%;height: 10px;"></div>
            </div>
        </div>
    </div>
    {% else %}
        <div style="text-align: center">
        <span>请点击<a href="{{ url_for('auth.login') }}">此处登陆</a>系统</span>
        </div>
    {% endif %}
{% endblock body %}